<?php

namespace Home\Controller;
use Home\Core\VmsSDK;

class SuperiorPlatformController extends BaseController
{
    /**
     * 获取上级平台列表
     */
    public function superiorPlatform()
    {
        $param = I('get.');
        if(empty(I('get.pageid'))){
            $param['pageid']=1;
        }else{
            $param['pageid']=$_GET['pageid'];
        }
        $pageid=$param['pageid'];
        $param['pagesize'] = PAGE_SIZE;
        $sdk = new VmsSDK();
        $return = $this->http_request($sdk::getSuperiorPlatformList,$param,'GET');
        $array =  json_decode( json_encode( $return ), true );
//        dump($array);
        $pagesum=$return->pagesum;
        $this->assign('pageid',$pageid);
        $this->assign('array',$array);
        $this->assign('pagesum',$pagesum);
        $this->display();
    }
    /**
     * 添加上级平台
     */
    public function addSuperiorPlatform()
    {
        $param = I('post.');
        $sdk = new VmsSDK();
        $return = $this->http_request($sdk::addSuperiorPlatform, $param, 'GET');
        $result = $return->result;//获取result的值
        $this->ajaxReturn($result);

    }
    /**
     * 修改上级平台
     */
    public function modifySuperiorPlatform()
    {
        $param = I('post.');
        $sdk = new VmsSDK();
        $return = $this->http_request($sdk::modifySuperiorPlatform, $param, 'GET');
        $result = $return->result;//获取result的值
        $this->ajaxReturn($result);

    }
    /**
     * 删除上级平台
     */
    public function delSuperiorPlatform()
    {
        $param = I('post.');
        $sdk = new VmsSDK();
        $return = $this->http_request($sdk::delSuperiorPlatform, $param, 'GET');
        $result = $return->result;//获取result的值
        $this->ajaxReturn($result);

    }


}